<template>
<el-dialog title="详情"
           :close-on-click-modal="false" append-to-body
           :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
           width="1000px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="mini" label-width="100px" >
    <template v-if="!loading">
        <el-col   :span="24" >
        <el-card class="mb-20" shadow ="always"  header ="基本信息">
            <el-col :span="6" >
                <el-form-item  label="客户名称"
 prop="customerName" >
                        <p>{{dataForm.customerName}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="项目"
 prop="project" >
                        <p>{{dataForm.project}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="来源"
 prop="customerSource" >
                        <p>{{dataForm.customerSource}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="客户类型"
 prop="customerType" >
                        <p>{{dataForm.customerType}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="客户性质"
 prop="customerNature" >
                        <p>{{dataForm.customerNature}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="所属行业"
 prop="industry" >
                        <p>{{dataForm.industry}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="社会信用代码/身份证"
 prop="customerCode" >
                        <p>{{dataForm.customerCode}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="详细地址"
 prop="detailedAddress" >
                        <p>{{dataForm.detailedAddress}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="备注"
 prop="remark" >
                        <p>{{dataForm.remark}}</p>
                </el-form-item>
            </el-col>
        </el-card>
        </el-col>
        <el-col   :span="24" >
        <el-card class="mb-20" shadow ="always"  header ="联系人">
            <el-col :span="6" >
                <el-form-item  label="联系人姓名"
 prop="contactName" >
                        <p>{{dataForm.contactName}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="联系人电话"
 prop="contactNumber" >
                        <p>{{dataForm.contactNumber}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="联系人邮箱"
 prop="contactEmail" >
                        <p>{{dataForm.contactEmail}}</p>
                </el-form-item>
            </el-col>
        </el-card>
        </el-col>
    </template>
</el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false"> 取 消</el-button>
    </span>
    </el-dialog>
</template>
<script>
    import request from '@/utils/request'
    import PrintBrowse from '@/components/PrintBrowse'
    import jnpf from '@/utils/jnpf'
    export default {
        components: {PrintBrowse},
        props: [],
        data() {
            return {
                visible: false,
                loading: false,
                printBrowseVisible: false,
                printId: '',
            dataForm: {
                id :'',
                            customerName : '',
                            project : '',
                            customerSource : "",
                            customerType : "1",
                            customerNature : "1",
                            industry : "",
                            customerCode : '',
                            detailedAddress : '',
                            remark : '',
                            contactName : '',
                            contactNumber : '',
                            contactEmail : '',
            },

        }
        },
        computed: {},
        watch: {},
        created() {

        },
        mounted() {},
        methods: {
            dataInfo(dataAll){
                let _dataAll =dataAll
                this.dataForm = _dataAll
            },

            init(id) {
                this.dataForm.id = id || 0;
                this.visible = true;
                this.$nextTick(() => {
                    if(this.dataForm.id){
                        this.loading = true
                        request({
                            url: '/api/zc/zcCustomer/detail/'+this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataInfo(res.data)
                            this.loading = false
                        })
                    }

                })
            },
        },
    }

</script>
